/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Bean;

import Model.Business.Business;
import Model.Entity.Book;
import java.util.ArrayList;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

/**
 *
 * @author CUONGTROC
 */
@ManagedBean
@RequestScoped
public class searchBean {

    /** Creates a new instance of searchBean */
    public searchBean() {
    }
    private ArrayList<Book> books;
    private String keyword;

    public String getKeyword() {
        return keyword;
    }

    public void setKeyword(String keyword) {
        this.keyword = keyword;
    }

    public ArrayList<Book> getBooks() {
        return books;
    }

    public void setBooks(ArrayList<Book> books) throws Exception {
        this.books = books;
    }
    public String searchBook(){
        try {            
            books=Business.searchBook(keyword);
        } catch (Exception e) {
        }
        return "SearchBook";
    }
}
